/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-04-14
 * Time:14:51
 */
public class Cuboid {
    private double length;
    private double width;
    private double height;

    public Cuboid() {

    }

    public Cuboid(double length, double height, double width) {
        this.length = length;
        this.width = width;
        this.height = height;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        if (length > 0) {
            this.length = length;
        }
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        if (height > 0) {
            this.height = height;
        }
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        if (width > 0) {
            this.width = width;
        }
    }

    public double getArea(){
        return 2*((this.length*this.width)+(this.length*this.height)+(this.width*this.height));
    }

    public double getCubage(){
        return this.height*this.length*this.width;
    }

    public boolean isCube(){
        if(this.width==this.length&&this.width==this.height&&this.length==this.height){
            return true;
        }else{
            return false;
        }
    }

    public void printCuboid(){
        System.out.println("长"+this.length);
        System.out.println("宽"+this.width);
        System.out.println("高"+this.height);
    }
}
